#include <iostream>
#include <conio.h>
#include <malloc.h>
#include <stdlib.h>
using namespace std;

#define LIST_INIT_SIZE 100
#define LISTINCREMENT
#ifdef _WIN32
#include <windows.h>
#endif
typedef struct
{
	char xuehao[14];
	char name[20];
	int sex;
	char tel[14];
	char qq[12];
}ElemType;
typedef struct
{
	ElemType *elem;
	int length;
	int listsize;
}SqList;

void InitSeqList(SqList &L)
{
	L.elem = (ElemType*)malloc(LIST_INIT_SIZE * sizeof(ElemType));
	L.length = 0;
	L.listsize = LIST_INIT_SIZE;
	return;
}

void InputSeqList(SqList &L)
{
	int n;
	ElemType *p;
	cout << "请输入初始化数据的个数："<<endl;
	cin >> n;
	p = L.elem;
	L.length = n;
	for (int i = 0; i < n; i++)
	{
		cout << "请输入第" << i + 1 << "个数据(学号 姓名 性别(0或1) 电话 QQ号):\n";
		cin >> p->xuehao;
		cin >> p->name;
		cin >> p->sex;
		cin >> p->tel;
		cin >> p->qq;
	}
}
void PrintSeqList(SqList &L)
{
	cout << "学号 姓名 性别 联系电话 QQ号\n";
	for (int i=0;i<L.length;i++)
	{
		cout << L.elem[i].xuehao << "  " << L.elem[i].name << "  ";
		if (!L.elem[i].sex) cout << "男  ";
		else cout << "女  ";
		cout << L.elem[i].tel << "  " << L.elem[i].qq << "  " << endl;
	}
}

int main(void)
{
#ifdef _WIN32
	SetConsoleOutputCP(65001);
#endif
	SqList L;
	InitSeqList(L);
	InputSeqList(L);
	PrintSeqList(L);

	return 0;
}